@use "color";

// Core: Typography
// ============================================================================

// Variables
// ----------------------------------------------------------------------------

$sans-font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif !default;
$mono-font-family: Open Sans Mono, Menlo, DejaVu Sans Mono, monospace !default;

// Standard font sizes
$normal-font-size: 13px;
$normal-line-height: 15px;

$big-font-size: 17px;
$big-line-height: 22px;

$small-font-size: 11px;
$small-line-height: 12px;

$title-font-size: 19px;
$subtitle-font-size: 15px;

// Font sizes for specific categories of control
$input-font-size: 15px;

// Minimum font size for <input> fields on iOS. If the font size is smaller than
// this, iOS will zoom into the field when focused.
$touch-input-font-size: 16px;

// Mixins
// ----------------------------------------------------------------------------

@mixin font-small {
  font-size: $small-font-size;
  line-height: $small-line-height;
  font-weight: 400;
  letter-spacing: 0.2px;
}

@mixin font-normal {
  font-size: $normal-font-size;
  line-height: $normal-line-height;
  font-weight: 400;
}

@mixin font-big {
  font-size: $big-font-size;
  line-height: $big-line-height;
}

@mixin styled-text() {
  // Reset the line-height in case any parent elements have set it.
  line-height: normal;

  h1, h2, h3, h4, h5, h6, p, ol, ul, img, pre, blockquote {
    margin: .618em 0;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: $sans-font-family;
  }

  // Use a modular scale for headings:
  // http://modularscale.com/scale/?px1=13&px2=16&ra1=1.618&ra2=0
  h1 {
    font-size: 2.618em;
    font-weight: bold;
    margin: .2327em 0;
  }

  h2 {
    font-size: 1.991em;
    font-weight: bold;
    margin: .309em 0;
  }

  h3 {
    font-size: 1.991em;
    margin: .309em 0;
  }

  h4 {
    font-size: 1.618em;
    margin: .3803em 0;
  }

  h5 {
    font-size: 1.231em;
    margin: .4944em 0;
  }

  h6 {
    font-size: 1.231em;
    margin: .4944em 0;
  }

  ol, ul {
    list-style-position: inside;
    padding-left: 0;

    ol, ul {
      padding-left: 1em;
    }
  }

  ol {
    list-style-type: decimal;
  }

  ul {
    list-style-type: disc;
  }

  ol, ul {
    ul {
      list-style-type: circle;
    }
  }

  li {
    margin-bottom: .291em;
  }

  li, p {
    line-height: 1.3;
  }

  a {
    text-decoration: underline;
  }

  img {
    display: block;
    max-width: 100%;
  }

  blockquote {
    @include font-normal;

    border-left: 3px solid color.$grey-3;
    color: color.$grey-4;
    font-family: sans-serif;
    font-size: 12px;
    font-style: italic;
    letter-spacing: 0.1px;
    padding: 0 1em;
    margin: 1em 0;

    p, ol, ul, img, pre, blockquote {
      margin: .7063em 0;
    }

    p, li {
      line-height: 1.5;
    }
  }

  code {
    font-family: $mono-font-family;
    font-size: .875em;
    color: black;
  }

  pre code {
    padding: 10px;
    display: block;
    background-color: color.$grey-1;
    border-radius: 2px;
  }
}

// Rules
// ----------------------------------------------------------------------------

// Explanatory text paragraphs
.text {
  color: color.$grey-6;
}

// Prompt used in the OAuth "Authorize access?" screen.
.text--auth-prompt {
  color: color.$grey-5;
  margin-bottom: 50px;
}
